﻿using System;

namespace Seed.IoC
{
    public static class ServiceLocator
    {
        public static IServiceLocator Current
        {
            get { return _locator ?? (_locator = _serviceLocatorProvider()); }
        }

        public static void SetServiceLocatorProvider(Func<IServiceLocator> serviceLocatorProvider)
        {
            _serviceLocatorProvider = serviceLocatorProvider;
        }

        private static IServiceLocator _locator;

        private static Func<IServiceLocator> _serviceLocatorProvider;
    }
}